package com.baizhi.luoht.controller;/**
 * @Author:luoht
 * @Description：
 * @Date：Create in 21:27 2018/10/24
 */

import com.baizhi.luoht.entity.User;
import com.baizhi.luoht.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @program: ems
 * @description:
 * @author: luoht
 * @create: 2018-10-24 21:27
 **/

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @Autowired
    private User user;

    @RequestMapping("/login")
    public String loginUser(User user){
        User showUser = userService.showUser(user.getUsername(), user.getPassword());
        System.out.println(showUser);
        return "redirect:/Emp/show.do";
    }


    public UserService getUserService() {
        return userService;
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
